function! api#startify#default() abort
    let g:startify_bookmarks = [
                \   { "p" : $PROJECT_CODE_BASE },
                \   {'c': '~/vimfiles/autoload/plug.vim'},
                \   '~/.zshrc'
                \ ]
    let g:startify_change_to_dir = 0
    let g:startify_change_to_vcs_root = 1
    let g:startify_change_cmd = 'lcd'
    let g:startify_custom_header = 'startify#pad(startify#fortune#cowsay())'
    let g:startify_enable_special = 1
    let g:startify_lists = [
                \ { 'type': 'files',     'header': ['   MRU']            },
                \ { 'type': 'dir',       'header': ['   MRU '. getcwd()] },
                \ { 'type': 'sessions',  'header': ['   Sessions']       },
                \ { 'type': 'bookmarks', 'header': ['   Bookmarks']      },
                \ { 'type': 'commands',  'header': ['   Commands']       },
                \ ]
    let g:startify_skiplist = [
                \ 'COMMIT_EDITMSG',
                \ 'bundle/.*/doc',
                \ '/data/repo/neovim/runtime/doc',
                \ '/Users/mhi/local/vim/share/vim/vim74/doc',
                \ ]
    let g:startify_update_oldfiles = 1

    " Misc options:~
    let g:startify_commands = [
        \ ':help reference',
        \ ['Vim Reference', 'h ref'],
        \ {'h': 'h ref'},
        \ ]
    " let g:startify_custom_footer|
    " let g:startify_custom_header_quotes|
    " let g:startify_custom_indices|
    " let g:startify_disable_at_vimenter|
    " let g:startify_enable_unsafe|
    let g:startify_files_number = 8
    let g:startify_fortune_use_unicode = 1
    let g:startify_padding_left = 3
    let g:startify_relative_path = 1
    " let g:startify_skiplist_server|
    " let g:startify_use_env|

    " Sessions:~
    let g:startify_session_autoload = 1
    let g:startify_session_before_save = [ 'silent! tabdo NERDTreeClose' ]
    let g:startify_session_delete_buffers = 1
    " let g:startify_session_dir|
    " let g:startify_session_number|
    let g:startify_session_persistence = 1
    " let g:startify_session_remove_lines|
    " let g:startify_session_savecmds|
    " let g:startify_session_savevars|
    " let g:startify_session_sort|
    hi StartifyBracket ctermfg=240
    hi StartifyFile    ctermfg=147
    hi StartifyFooter  ctermfg=240
    hi StartifyHeader  ctermfg=114
    hi StartifyNumber  ctermfg=215
    hi StartifyPath    ctermfg=245
    hi StartifySlash   ctermfg=240
    hi StartifySpecial ctermfg=240
endfunction

function! api#startify#init() abort
    if !exists('g:loaded_startify')
        try
            packadd vim-startify
        catch /.*/
        endtry
    endif
    if exists('g:loaded_startify')
        let g:buffer_keymap = get(g:, "buffer_keymap", { "name": "+buffer" })
        let g:buffer_keymap.s = [":Startify", "startify"]
        let g:space_keymap = get(g:, 'space_keymap', {'name': '+space'})
        let g:space_keymap.b = g:buffer_keymap
        call api#startify#default()
    endif
endfunction
